<template>

<div>
  <el-row>
    <mu-appbar title="领取金币记录" style="background-color:#409EFF">
      <mu-icon-button  icon="arrow_back_ios" slot="left" :to="{name: 'AboutMe' }"/>
    </mu-appbar>
  </el-row>

  <el-row>
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="agentUid"
        label="代理ID">
      </el-table-column>
      <el-table-column
        prop="recNdot"
        label="领取业绩">
      </el-table-column>
      <el-table-column
        prop="recTime"
        label="领取时间">
      </el-table-column>
    </el-table>
  </el-row>
</div>

</template>

<style scoped>
  .el-row {
    margin-bottom: 16px;
  }
  .el-col {
    margin-bottom: 8px;
  }
</style>

<script>
  import moment from 'moment'
  export default {
    data () {
      return {
        tableData: [],
        condition: {
          account: sessionStorage.getItem('account')
        }
      }
    },
    methods: {
      handleFind () {
        let that = this
        this.$axios({
          method: 'get',
          url: '/api/AgentService.recYuanBao',
          params: this.condition
        })
        .then(function (resp) {
          for (let item in resp.data.data) {
            resp.data.data[item].recTime = moment.utc(resp.data.data[item].recTime).zone(-8).format('YYYY-MM-DD HH:mm:ss')
          }
          that.tableData = resp.data.data
        })
      },
      init () {
        this.handleFind()
      }
    },
    mounted () {
      this.init()
    }
  }
</script>
